﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script src="/Scripts/jquery-1.3.1.js" type="text/javascript"></script>

    <script src="/Scripts/jBindSelect.js" type="text/javascript"></script>

</head>
<body>
    <div>
    Bind with a array.<br />
    If you use this method,you&#39;ll don&#39;t use the &#39;text&#39; &amp; &#39;value&#39; option.<br />
<select id="demo1">
        </select>
        <br />
    </div>
    <hr />
    <div>
    Bind with a json datasource.
        <select id="demo2">
        </select>
    </div>

    <script type="text/javascript">
        $("#demo1").bindselect({
            source: [1, 2, 3, 4]
        });

        $("#demo2").bindselect({
            source: [{ name: "Jian Zou", id: 1 }, { name: "chsword", id: 2 }, { name: "ZhongDian", id: 3}],
            text: 'name',
            value: 'id',
            selectvalue:3
        });
    </script>

</body>
</html>
